import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'lib_bt_method_channel.dart';
import 'listener/OnBleConnectListener.dart';
import 'listener/OnBleDataListener.dart';
import 'listener/OnBleScanListener.dart';
import 'listener/OnOtaListener.dart';

abstract class LibBtPlatform extends PlatformInterface {
  /// Constructs a LibBtPlatform.
  LibBtPlatform() : super(token: _token);

  static final Object _token = Object();


  //设置蓝牙连接回调
  void setOnBleConnectListener(OnBleConnectListener listener);
  void setOnBleScanListener(OnBleScanListener listener);
  void setOnOtaListener(OnOtaListener listener);
  void setOnBleDataListener(OnBleDataListener listener);

  static LibBtPlatform _instance = MethodChannelLibBt();

  /// The default instance of [LibBtPlatform] to use.
  ///
  /// Defaults to [MethodChannelLibBt].
  static LibBtPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [LibBtPlatform] when
  /// they register themselves.
  static set instance(LibBtPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<String?> getPlatformVersion() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  Future<T?> invokeMethod<T>(String method, [ dynamic arguments ]) {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }
}
